package org.crackjack.android.model;

import java.io.Serializable;

import android.os.Parcel;
import android.os.Parcelable;

public class Appointment extends Identify implements Serializable, Parcelable {

    private static final long serialVersionUID = -5918857725187646437L;
    private String name;
    private String description;
    private Double rating;
    private Location location;
    private Category category;
    private Profile appointmentOwner;

    public static final Parcelable.Creator<Appointment> CREATOR = new Parcelable.Creator<Appointment>() {

        @Override
        public Appointment createFromParcel(Parcel source) {
            return new Appointment(source);
        }

        @Override
        public Appointment[] newArray(int size) {
            return new Appointment[size];
        }
    };

    private Appointment(Parcel parcel) {
        id = parcel.readLong();
        name = parcel.readString();
        description = parcel.readString();
        rating = parcel.readDouble();
        category = parcel.readParcelable(Category.class.getClassLoader());
        appointmentOwner = parcel.readParcelable(Profile.class.getClassLoader());
    }

    public Appointment() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Double getRating() {
        return rating;
    }

    public void setRating(Double rating) {
        this.rating = rating;
    }

    public Location getLocation() {
        return location;
    }

    public void setLocation(Location location) {
        this.location = location;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Profile getAppointmentOwner() {
        return appointmentOwner;
    }

    public void setAppointmentOwner(Profile appointmentOwner) {
        this.appointmentOwner = appointmentOwner;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeString(name);
        dest.writeString(description);
        dest.writeDouble(rating);
        dest.writeParcelable(category, flags);
        dest.writeParcelable(appointmentOwner, flags);
    }

}
